﻿using System;
using DocumentManager.Abstractions.Factories;
using DocumentManager.Abstractions.Interfaces.Helpers;
using DocumentManager.Helpers;
using GrigSoft.Managers.Abstractions.Interfaces.IO;

namespace DocumentManager.Factories
{
	public class HelperFactory : HelperBaseFactory
	{
		#region Variables

		private readonly IFileManager _fileManager;

		#endregion

		#region Constructors

		public HelperFactory(IFileManager fileManager)
		{
			if (fileManager == null)
				throw new ArgumentNullException(string.Format("file Manager"));
			_fileManager = fileManager;
		}

		#endregion

		#region HelperBaseFactory Members

		public override IPasswordGenerator CreatePasswordGenerator()
		{
			return new PasswordGenerator();
		}

		public override IApplicationConfiguration CreateApplicationConfiguration()
		{
			return new ApplicationConfiguration();
		}

		public override IWordDocumentAdapter CreateWordDocumentAdapter()
		{
			return new WordDocumentAdapter(_fileManager);
		}

		public override IPrintDocumentManager CreatePrintDocumentManager()
		{
			return new PrintDocumentManager();
		}

		#endregion
	}
}
